<?php
$sanitize_all_escapes = true;
$fake_register_globals = false;
session_start();
$ignoreAuth = true;
include_once('../interface/globals.php');
// we should set the appropriate header information. Do not forget this.

if(isset($_REQUEST["favorite"])){
    $favorite = $_REQUEST["favorite"] == "Si" ? 1 : 0;
    sqlStatement("UPDATE patient_provider SET favorite=$favorite WHERE id = {$_REQUEST["id"]}");
    echo "Favorito editado.";
}
else if(isset($_REQUEST["patient_general_data"])){
    $patient_general_data = $_REQUEST["patient_general_data"] == "Si" ? 1 : 0;
    sqlStatement("UPDATE patient_provider SET patient_general_data=$patient_general_data WHERE id = {$_REQUEST["id"]}");

    echo "Ver datos generales editado.";
}
else if(isset($_REQUEST["details_auth_by_patient"])){
    $details_auth_by_patient = $_REQUEST["details_auth_by_patient"] == "Si" ? 1 : 0;
    sqlStatement("UPDATE patient_provider SET details_auth_by_patient=$details_auth_by_patient WHERE id = {$_REQUEST["id"]}");
    echo "Ver detalles editado.";
}
?>
